package mapper

import (
	"fmt"

	"github.com/gin-gonic/gin"
)

type Asset struct {
	ID    string `json:"id"`
	Owner string `json:"owner"`
	Name  string `json:"name"`
	Info  string `json:"info"`
}

func (Asset) Create(ctx *gin.Context) {
	var asset Asset

	if err := ctx.ShouldBind(&asset); err != nil {
		fmt.Println("绑定成功：", err)
	}

	fmt.Println(asset)

	ctx.JSON(200, gin.H{
		"message": "success",
	})
}
func (Asset) Query(ctx *gin.Context) {
	id := ctx.Query("id")

	fmt.Println(id)

	ctx.JSON(200, gin.H{
		"message": id,
	})
}
